#include "TimeController.h"

CTimeController::CTimeController(void):m_applicationTime(this, 0), m_startTime(0), m_endTime(0){}

void CTimeController::doUpdate()
{
	float currentApplicationTime=m_applicationTime.getValue();
	if(currentApplicationTime>=m_startTime)
	{
		if(currentApplicationTime<=m_endTime)
			setValue(currentApplicationTime-m_startTime);
		else
		{
			if(m_endTime<0)
				setValue(currentApplicationTime-m_startTime);
			else
				setValue(m_endTime-m_startTime);
		}
	}
	else
		setValue(0);

}
